<script setup>
import Header from "./components/Header.vue";
import { defineUser } from "./stores/userStore.js";
let sysUser = defineUser()
</script>


<template>
  <div class="container">
    <Header></Header>
    <el-container>
      <el-aside width="200px" class="sidebar"  v-if="sysUser.username!=''">
        <div class="menu">
          <router-link to="/index" class="menu-item">
            <i class="el-icon-date"></i>
            <span>首页</span>
          </router-link>

          <router-link to="/showSchedule" class="menu-item">
            <i class="el-icon-date"></i>
            <span>查看我的日程</span>
          </router-link>
          <!-- 其他菜单项 -->
        </div>
      </el-aside>
      <el-container>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
      
    </el-container>
  </div>
</template>

<style scoped>
.container {
  background-color: #f5f7fa; /* 更柔和的背景色 */
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar {
  background-color: #b7cb92;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  height: 400px;
}

.menu {
  padding: 20px;
}

.menu-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.3s ease;
  padding: 10px; /* 调整菜单项内部间距 */
  border-radius: 5px; /* 圆角边框 */
}

.menu-item:hover {
  background-color: #e6f7ff; /* 悬停效果更柔和 */
}

.menu-item i {
  margin-right: 10px;
}

.menu-item span {
  font-weight: bold; /* 字体加粗 */
}
.el-main {
  border: 2px solid red; /* 添加红色边框 */
  padding-left: 10px; /* 调整内容与边框的间距 */
}

</style>
